package cn.qingxuntech.console.config

import com.aliyun.odps.Odps
import com.aliyun.odps.account.AliyunAccount
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

/**
 * @author zooy
 * @since 2025/10/31-17:24
 */
@Configuration
@EnableConfigurationProperties(AliyunProperties::class, QingXunTechProperties::class)
class QingXunConsoleConfiguration {

    @Bean
    fun odps(aliyunProperties: AliyunProperties): Odps {
        return Odps(AliyunAccount(aliyunProperties.accessId, aliyunProperties.accessKey)).also {
            it.endpoint = aliyunProperties.endpoint
            it.defaultProject = aliyunProperties.project
        }
    }

}
